﻿<Window x:Class="WPFDemo.Window1"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:controls="clr-namespace:Microsoft.Lync.Controls;assembly=Microsoft.Lync.Controls"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:Converters="clr-namespace:WPFDemo.Converters"
    mc:Ignorable="d"  xml:lang="ja-JP"
    Title="Lync WPF" Height="700" Width="403">
    <Window.Resources>
        <Converters:BooleanToVisibility x:Key="BooleanToVisibility"/>
        <Converters:NotBooleanToVisibility x:Key="NotBooleanToVisibility"/>
    </Window.Resources>

    <Grid Margin="0,0,0.333,-7.333">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>
        
        <controls:MyStatusArea Name="myStatusArea1" Margin="10,10,0.334,0.333" Background="Transparent" Grid.ColumnSpan="2"/>

        <!-- ContactSearchInputBoxはユーザーが検索ボックスに文字を入力して連絡先を検索することができる機能です。-->

        <controls:ContactSearchInputBox
                x:Name="ocSearchInput"
                MaxResults="10"
                Grid.Row="0" Margin="0,157,-1.333,336.333"
         />

        <!--ContactsearchResultlistはContactSearchInputBoxの検索結果を表示します。-->

            <controls:ContactSearchResultList
                x:Name="ocSearchResults"
                ItemsSource="{Binding Results, ElementName=ocSearchInput}"
                ResultsState="{Binding SearchState, ElementName=ocSearchInput, Mode=OneWay}"
                Visibility="{Binding Path=SearchState,ElementName=ocSearchInput,
                                     Converter={StaticResource BooleanToVisibility},
                                     ConverterParameter=cleared}" 
                                     Margin="10,221,8.667,5.333" Grid.ColumnSpan="2"
                />

        <!--ContactListコントロールはLyncにログインしているユーザーの連絡先リストを表示します。-->

        <controls:ContactList 
                Grid.Row="0"
                x:Name="ocContactList"
                Background="White"
                Visibility="{Binding
                                    Path=SearchState,
                                    ElementName=ocSearchInput,
                                    Converter={StaticResource NotBooleanToVisibility},
                                    ConverterParameter=cleared}"
                                    Margin="10,193,8.667,20" Grid.RowSpan="2"
                />
        <Button x:Name="AddContactButton" Content="連絡先追加/削除" HorizontalAlignment="Left" Height="20" 
                Margin="10,123,0,0" VerticalAlignment="Top" Width="120" Click="AddContactButton_Click"/>
        <Button x:Name="AddCustomGroupButton" Content="カスタムグループ追加/削除" HorizontalAlignment="Left" Height="20" 
                Margin="135,123,0,0" VerticalAlignment="Top" Width="130" Click="AddCustomGroupButton_Click"/>
        <Button Content="カンバセーション" HorizontalAlignment="Left" Margin="270,123,0,0" VerticalAlignment="Top" 
                Width="108" Click="Conversion_Click"/>

    </Grid>

</Window>
